#pragma once

#include <vex/policy/protect_policy.h>
#include <functional>

namespace vex { namespace policy {
    template < class TClass, class TClassTraits, class TBase = vex::policy::empty_base >
    class hashable : public TBase {
    public:
        struct hash : public std::unary_function<TClass const &, std::size_t> {
            std::size_t operator()(TClass const & p_handle) const
            {
                return std::hash<typename TClassTraits::item_type>()(p_handle.get());
            }
        };

        static hash get_hash_function()
        {
            return hashable::hash();
        }

        VEX_PROTECT_POLICY(hashable);
    };
}}